var barDom = document.getElementById('barChart');
var barChart = echarts.init(barDom);
var barData = {
        title: '放款额度、笔数',
        xAxis: ['加盟宝', '升级宝', '贷款宝', '项目宝', '提货宝', '一级经销商融资产品'],
        data: [Math.random()*50+50, 52, 200, 334, 390, 330],
        count: [3, 7, 9, 25, 21, 41]
}
var barOption = {
    title: {
      text: barData.title,
      x: 'center'
    },
    tooltip: {
      trigger: 'axis',
      axisPointer: { // 坐标轴指示器，坐标轴触发有效
        type: 'shadow' // 默认为直线，可选为：'line' | 'shadow'
      }
    },
    color,
    grid: {
      top: 50,
      left: '2%',
      right: '3%',
      bottom: '3%',
      containLabel: true
    },
    yAxis: [{
      type: 'category',
      data: barData.xAxis,
      axisLabel: {
        rotate : 20
      },
      axisTick: {
        alignWithLabel: true
      }
    }],
    xAxis: [{
      type: 'value',
      axisTick: {
        show: false
      }
    }],
    series: [{
      name: '放款额度',
      type: 'bar',
    //   stack: 'vistors',
      barWidth: '30%',
      data: barData.data,
      animationDuration: 3000,
      animationEasing: 'elasticOut',
      animationDelayUpdate: function (idx) {
        return idx * 5;
      }
    },{
        name: '放款笔数',
        type: 'bar',
        // stack: 'vistors',
        barWidth: '30%',
        data: barData.count,
        animationDuration: 3000,
        animationEasing: 'elasticOut',
        animationDelayUpdate: function (idx) {
          return idx * 5;
        }
      }]
  }

barChart.setOption(barOption)